package net.newsmth.smthapp.android.util;

import android.content.Context;
import android.content.res.Resources;

import net.newsmth.smthapp.android.R;
import net.newsmth.smthapp.android.config.SmthNetStatusType;

/**
 * Created by Hatsune Miku on 3/30/14.
 */

public class TextCreatorUtil {
    public static String getNetworkMessage(Context context, SmthNetStatusType statusType, String errorMessage) {
        Resources res = context.getResources();
        switch (statusType) {
            case NETWORK_FAILURE:
                return  res.getString(R.string.net_error_net_failure);
            case SERVER_ERROR:
                return res.getString(R.string.net_error_server_error);
            case PASSWORD_ERROR:
                return res.getString(R.string.net_error_password_error);
            case OTHERS:
                return errorMessage;
            default:
                return res.getString(R.string.net_error_default_error);
        }
    }
}
